//
//  baseDefine.h
//  test
//
//  Created by fox on 12-11-29.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#ifndef baseDefine_h
#define baseDefine_h

#include <stdio.h>

#ifdef WIN32


#include <WinSock2.h>
#include <ws2tcpip.h>
#include <mstcpip.h>
#include <mswsock.h>
#include <Windows.h>
#else
#include <stdint.h>
#endif

#include "baseSingle.h"

#include <vector>
#include <list>
#include <string>
#include <queue>
#include <map>
using namespace std;


namespace FOXSDK
{
 
    
#ifdef WIN32
    typedef __int64                     fint64;
#else
    typedef int64_t                     fint64;
#endif
    typedef unsigned long long          fuint64;
    
    typedef wchar_t						fwchar;
    
    typedef char						fbyte;
    typedef unsigned char				fubyte;
    
    typedef short						fint16;
    typedef unsigned short				fuint16;
    
    typedef int							fint32;
    typedef unsigned int				fuint32;
    
    typedef int                         flong;
    typedef unsigned int				fulong;
    
    typedef void						fvoid;
    
    typedef float						freal32;
    typedef double						freal64;
    
    typedef int							fbool;
    
    
    
    struct netMsgHead
    {
        fuint16 size;
        fuint16 type;
    };



	static const fbyte* LTOA( long l )
	{
		static fbyte buffer[ 64 ];
		sprintf( buffer , "%ld" , l );
		return buffer;
	}

	static const fbyte* ITOA( fint32 i )
	{
		static fbyte buffer[ 32 ];
		sprintf( buffer , "%d" , i );
		return buffer;
	}

	static const fbyte* FTOA( freal32 f )
	{
		static fbyte buffer[ 32 ];
		sprintf( buffer , "%f" , f );
		return buffer;
	}


};


    
#define F_TRUE 1
#define F_FALSE 0
#define F_NULL 0
    
#define F_SAFE_DELETE(a) if( a ){ delete a; }
#define F_SAFE_RELEASE(a) if( a ){ a->Release(); }
    
#define F_USE_PRINT
    
#ifdef WIN32

#include "crtMemcpy.h"

//#define MEMCPY FOXSDK::SSE2Memcpy
#define MEMCPY memcpy

#else
    
#define MEMCPY memcpy
    
#endif
    
    
#define STRCMP strcmp
#define STRCPY strcpy
#define ATOF atof
#define ATOI atoi
#define SPRINTF sprintf

#define RAND rand

#ifdef ASSERT
#undef ASSERT
#endif 
#define ASSERT assert

    
#include "fileTools.h"

#endif





